<!doctype html>
<html>
<?php echo $this->fetch('head.html'); ?>

<body>
<div class="header" >
  
  <div class="title">打款管理</div>
  <a class="right-btn" target="_blank" href="/index.php?m=cron&a=Ymdian_dakuan">生成打款</a>
</div>
<form method="get" action="<?php echo $this->_var['appadmin']; ?>" class="pd-5" >
<input type="hidden" name="m" value="ymdian_dakuan" />
<input type="hidden" name="a" value="default" />
	<div class="row">
    	<span>
        <?php $this->assign("sites",M("sites")->select(array("where"=>"1"))); ?>
学校：<select name="siteid" class="w100">
<option value="0">请选择</option>
<?php $_from = $this->_var['sites']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?> 
<option value="<?php echo $this->_var['c']['siteid']; ?>" <?php if (get ( 'siteid' ) == $this->_var['c']['siteid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_var['c']['sitename']; ?></option>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</select>
        
        </span>
        <span>
        <?php $this->assign("shops",M("ymdian")->select(array("where"=>"1"))); ?>
        店铺：
        <select name="shopid" class="w100">
        	<option value="0">请选择</option>
            <?php $_from = $this->_var['shops']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 's');if (count($_from)):
    foreach ($_from AS $this->_var['s']):
?>
            <option value="<?php echo $this->_var['s']['id']; ?>" <?php if ($this->_var['s']['id'] == get ( 'shopid' )): ?> selected<?php endif; ?>><?php echo $this->_var['s']['title']; ?></option>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </select>
        </span>
        <span>
        打款状态：
        <select name="status" class="w100">
        	<option value="0">请选择</option>
            <option value="1" <?php if (get ( 'status' ) == 1): ?> selected<?php endif; ?>>未确认</option>
            <option value="2" <?php if (get ( 'status' ) == 2): ?> selected<?php endif; ?>>已完成</option>
            <option value="4" <?php if (get ( 'status' ) == 4): ?> selected<?php endif; ?>>已取消</option>
        </select>
        </span>
        </div>
        <div class="row">
        开始时间：<input type="text" name="start_time" value="<?php echo $_GET['start_time']; ?>"  onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间：<input type="text" name="end_time" value="<?php echo $_GET['end_time']; ?>"   onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
<input type="submit" value="搜索" class="btn btn-warning" />
    </div>
</div>
</form>
<div class="skyline"></div>
<div class="uclist">
	<?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
		<div class="item">
        	<div class="hd"><?php if ($this->_var['c']['status'] == 4): ?>已取消<?php elseif ($this->_var['c']['status'] == 2): ?>已完成<?php else: ?>待完成<?php endif; ?> &nbsp;<?php if ($this->_var['c']['ispay'] == 1): ?>未支付 <?php if (time ( ) > $this->_var['c']['endtime']): ?><span style="color:red">打款超时</span><?php endif; ?> <?php else: ?>已支付<?php endif; ?>  <span class="right">￥<?php echo $this->_var['c']['money']; ?></span> </div>
            
            <div class="row h30">到期时间：<?php echo date("Y-m-d",$this->_var['c']['endtime']); ?> <span class="right">生成时间：<?php echo date("Y-m-d",$this->_var['c']['dateline']); ?></span></div>
            <div class="row h30">学校：<?php echo $this->_var['c']['site_name']; ?> <span class="right">店铺：<?php echo $this->_var['c']['shop_name']; ?></span></div>
            <div class="info"><?php echo $this->_var['c']['content']; ?></div>
            <?php if ($this->_var['c']['payinfo']): ?>
            <div class="info"><?php echo $this->_var['c']['payinfo']; ?></div>
            <?php endif; ?>
            
            <div class="tools">
            	<a href="<?php echo $this->_var['appadmin']; ?>?m=ymdian_dakuan&a=add&id=<?php echo $this->_var['c']['id']; ?>">查看付款</a>
            </div>
        </div>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</div>
<?php echo $this->_var['pagelist']; ?>
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script>
</body>
</html>
